Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid raising SQL exceptions in the common case of updating an annotation #412

Merged

Conversation

jaylorch
Copy link
Contributor

Before trying to insert a new annotation, check if it already exists. This way, the only case where an exception will be generated is in the following rare race condition: we check if it exists and find it doesn't; a teammate creates the annotation; we try to insert the annotation and hit an duplicate-key exception since it already exists.

@jaylorch jaylorch requested a review from tabascq April 25, 2019 02:52
@jenetlan jenetlan merged commit 84dc040 into PuzzleServer:master Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants